.class Lcom/nemustech/regina/DialogCare$ApptAppAdapter;
.super Landroid/widget/BaseAdapter;
.source "DialogCare.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/regina/DialogCare;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ApptAppAdapter"
.end annotation


# instance fields
.field mAppFilter:Lcom/nemustech/regina/ReginaAppFilter;

.field mPkgMgr:Landroid/content/pm/PackageManager;

.field mRunningAppList:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Landroid/content/pm/ResolveInfo;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lcom/nemustech/regina/DialogCare;


# direct methods
.method public constructor <init>(Lcom/nemustech/regina/DialogCare;)V
    .locals 2
    .parameter

    .prologue
    .line 227
    iput-object p1, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->this$0:Lcom/nemustech/regina/DialogCare;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 228
    new-instance v0, Lcom/nemustech/regina/ReginaAppFilter;

    invoke-static {p1}, Lcom/nemustech/regina/DialogCare;->access$200(Lcom/nemustech/regina/DialogCare;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/nemustech/regina/ReginaAppFilter;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mAppFilter:Lcom/nemustech/regina/ReginaAppFilter;

    .line 229
    invoke-static {p1}, Lcom/nemustech/regina/DialogCare;->access$200(Lcom/nemustech/regina/DialogCare;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v0

    invoke-virtual {v0}, Lcom/nemustech/regina/ReginaLauncher;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    iput-object v0, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mPkgMgr:Landroid/content/pm/PackageManager;

    .line 230
    return-void
.end method


# virtual methods
.method public getCount()I
    .locals 2

    .prologue
    .line 234
    iget-object v0, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mAppFilter:Lcom/nemustech/regina/ReginaAppFilter;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ReginaAppFilter;->getMainAppList(Z)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mRunningAppList:Ljava/util/List;

    .line 235
    iget-object v0, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mRunningAppList:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "arg0"

    .prologue
    .line 240
    const/4 v0, 0x0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 277
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 12
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 245
    move-object v6, p2

    .line 246
    .local v6, row:Landroid/view/View;
    if-nez v6, :cond_0

    .line 247
    iget-object v9, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->this$0:Lcom/nemustech/regina/DialogCare;

    invoke-static {v9}, Lcom/nemustech/regina/DialogCare;->access$200(Lcom/nemustech/regina/DialogCare;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v9

    invoke-virtual {v9}, Lcom/nemustech/regina/ReginaLauncher;->getLayoutInflater()Landroid/view/LayoutInflater;

    move-result-object v2

    .line 248
    .local v2, inflator:Landroid/view/LayoutInflater;
    const v9, 0x7f030007

    const/4 v10, 0x0

    invoke-virtual {v2, v9, v10}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v6

    .line 251
    .end local v2           #inflator:Landroid/view/LayoutInflater;
    :cond_0
    iget-object v9, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mRunningAppList:Ljava/util/List;

    invoke-interface {v9, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Landroid/content/pm/ResolveInfo;

    .line 252
    .local v5, resolveInfo:Landroid/content/pm/ResolveInfo;
    iget-object v9, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->this$0:Lcom/nemustech/regina/DialogCare;

    invoke-static {v9}, Lcom/nemustech/regina/DialogCare;->access$200(Lcom/nemustech/regina/DialogCare;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v9

    iget-object v10, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mPkgMgr:Landroid/content/pm/PackageManager;

    invoke-virtual {v5, v10}, Landroid/content/pm/ResolveInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v10

    invoke-static {v9, v10}, Lcom/nemustech/regina/RUtils;->createIconThumbnail(Landroid/content/Context;Landroid/graphics/drawable/Drawable;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 253
    .local v0, appIcon:Landroid/graphics/Bitmap;
    iget-object v9, p0, Lcom/nemustech/regina/DialogCare$ApptAppAdapter;->mPkgMgr:Landroid/content/pm/PackageManager;

    invoke-virtual {v5, v9}, Landroid/content/pm/ResolveInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    .line 255
    .local v1, appName:Ljava/lang/String;
    const v9, 0x7f090016

    invoke-virtual {v6, v9}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/LinearLayout;

    .line 256
    .local v4, lAppInfo:Landroid/widget/LinearLayout;
    new-instance v7, Ljava/util/HashMap;

    invoke-direct {v7}, Ljava/util/HashMap;-><init>()V

    .line 257
    .local v7, tagMap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    const-string v9, "pkg"

    new-instance v10, Ljava/lang/StringBuilder;

    invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V

    const-string v11, "PKG:"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v7, v9, v10}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 258
    const-string v9, "cls"

    new-instance v10, Ljava/lang/StringBuilder;

    invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V

    const-string v11, "CLS:"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v7, v9, v10}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 259
    invoke-virtual {v4, v7}, Landroid/widget/LinearLayout;->setTag(Ljava/lang/Object;)V

    .line 262
    const v9, 0x7f090017

    invoke-virtual {v6, v9}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/ImageView;

    .line 263
    .local v3, iv:Landroid/widget/ImageView;
    if-eqz v0, :cond_1

    .line 264
    invoke-virtual {v3, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 269
    :goto_0
    const v9, 0x7f090018

    invoke-virtual {v6, v9}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v8

    check-cast v8, Landroid/widget/TextView;

    .line 270
    .local v8, tv:Landroid/widget/TextView;
    invoke-virtual {v8, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 271
    return-object v6

    .line 266
    .end local v8           #tv:Landroid/widget/TextView;
    :cond_1
    const v9, 0x7f02004e

    invoke-virtual {v3, v9}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_0
.end method
